<html>
<head>
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
	<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
	<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
    $("a.toggle").toggle(function(){
        $(this).text($(this).text().replace(/隐藏/,'显示'));
        var a=$(this).parents(".summary");
        a.find(".inherited").hide();
    },function(){
        $(this).text($(this).text().replace(/显示/,'隐藏'));
        $(this).parents(".summary").find(".inherited").show();
    });
});
</script>


   <!-- 左侧栏 -->
	<div class="container">
	<div class="row">
    <div id="subpage_sidebar" class="left apidoc-classes-index span3">

      

<h3>包 core</h3>

<ul>
    <li>
    <a href="./class-q.html" title="Q">Q</a>
  </li>
    <li>
    <a href="./class-qexception.html" title="QException">QException</a>
  </li>
    <li>
    <a href="./class-qcoll.html" title="QColl">QColl</a>
  </li>
    <li>
    <a href="./class-qcontext.html" title="QContext">QContext</a>
  </li>
    <li>
    <a href="./class-qlog.html" title="QLog">QLog</a>
  </li>
  
</ul>


<h3>包 mvc</h3>

<ul>
    <li>
    <a href="./class-qacl.html" title="QACL">QACL</a>
  </li>
    <li>
    <a href="./class-qcontroller-abstract.html" title="QController_Abstract">QController_Abstract</a>
  </li>
    <li>
    <a href="./class-qcontroller-forward.html" title="QController_Forward">QController_Forward</a>
  </li>
    <li>
    <a href="./class-qrouter.html" title="QRouter">QRouter</a>
  </li>
    <li>
    <a href="./class-qview-output.html" title="QView_Output">QView_Output</a>
  </li>
    <li>
    <a href="./class-qview-redirect.html" title="QView_Redirect">QView_Redirect</a>
  </li>
    <li>
    <a href="./class-qview-render-php.html" title="QView_Render_PHP">QView_Render_PHP</a>
  </li>
    <li>
    <a href="./class-qview-render-php-parser.html" title="QView_Render_PHP_Parser">QView_Render_PHP_Parser</a>
  </li>
  
</ul>


<h3>包 orm</h3>

<ul>
    <li>
    <a href="./class-qdb-activerecord-behavior-abstract.html" title="QDB_ActiveRecord_Behavior_Abstract">QDB_ActiveRecord_Behavior_Abst...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-abstract.html" title="QDB_ActiveRecord_Abstract">QDB_ActiveRecord_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-abstract.html" title="QDB_ActiveRecord_Association_Abstract">QDB_ActiveRecord_Association_A...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-belongsto.html" title="QDB_ActiveRecord_Association_BelongsTo">QDB_ActiveRecord_Association_B...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-coll.html" title="QDB_ActiveRecord_Association_Coll">QDB_ActiveRecord_Association_C...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-hasmany.html" title="QDB_ActiveRecord_Association_HasMany">QDB_ActiveRecord_Association_H...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-hasone.html" title="QDB_ActiveRecord_Association_HasOne">QDB_ActiveRecord_Association_H...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-manytomany.html" title="QDB_ActiveRecord_Association_ManyToMany">QDB_ActiveRecord_Association_M...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-meta.html" title="QDB_ActiveRecord_Meta">QDB_ActiveRecord_Meta</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-view.html" title="QDB_ActiveRecord_View">QDB_ActiveRecord_View</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-viewmeta.html" title="QDB_ActiveRecord_ViewMeta">QDB_ActiveRecord_ViewMeta</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-callbacks.html" title="QDB_ActiveRecord_Callbacks">QDB_ActiveRecord_Callbacks</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-interface.html" title="QDB_ActiveRecord_Interface">QDB_ActiveRecord_Interface</a>
  </li>
  
</ul>


<h3>包 form</h3>

<ul>
    <li>
    <a href="./class-qform-element.html" title="QForm_Element">QForm_Element</a>
  </li>
    <li>
    <a href="./class-qform-group.html" title="QForm_Group">QForm_Group</a>
  </li>
    <li>
    <a href="./class-qform.html" title="QForm">QForm</a>
  </li>
  
</ul>


<h3>包 database</h3>

<ul>
    <li>
    <a href="./class-qdb-adapter-abstract.html" title="QDB_Adapter_Abstract">QDB_Adapter_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-mysql.html" title="QDB_Adapter_Mysql">QDB_Adapter_Mysql</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pdo-abstract.html" title="QDB_Adapter_Pdo_Abstract">QDB_Adapter_Pdo_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pdo-exception.html" title="QDB_Adapter_Pdo_Exception">QDB_Adapter_Pdo_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pdo-pgsql.html" title="QDB_Adapter_Pdo_Pgsql">QDB_Adapter_Pdo_Pgsql</a>
  </li>
    <li>
    <a href="./class-qdb-adapter-pgsql.html" title="QDB_Adapter_Pgsql">QDB_Adapter_Pgsql</a>
  </li>
    <li>
    <a href="./class-qdb-cond.html" title="QDB_Cond">QDB_Cond</a>
  </li>
    <li>
    <a href="./class-qdb.html" title="QDB">QDB</a>
  </li>
    <li>
    <a href="./class-qdb-expr.html" title="QDB_Expr">QDB_Expr</a>
  </li>
    <li>
    <a href="./class-qdb-result-abstract.html" title="QDB_Result_Abstract">QDB_Result_Abstract</a>
  </li>
    <li>
    <a href="./class-qdb-result-mysql.html" title="QDB_Result_Mysql">QDB_Result_Mysql</a>
  </li>
    <li>
    <a href="./class-qdb-result-pdo.html" title="QDB_Result_Pdo">QDB_Result_Pdo</a>
  </li>
    <li>
    <a href="./class-qdb-result-pgsql.html" title="QDB_Result_Pgsql">QDB_Result_Pgsql</a>
  </li>
    <li>
    <a href="./class-qdb-select.html" title="QDB_Select">QDB_Select</a>
  </li>
    <li>
    <a href="./class-qdb-table.html" title="QDB_Table">QDB_Table</a>
  </li>
    <li>
    <a href="./class-qdb-table-lite.html" title="QDB_Table_Lite">QDB_Table_Lite</a>
  </li>
  
</ul>


<h3>包 helper</h3>

<ul>
    <li>
    <a href="./class-helper-filesys.html" title="Helper_Filesys">Helper_Filesys</a>
  </li>
    <li>
    <a href="./class-helper-array.html" title="Helper_Array">Helper_Array</a>
  </li>
    <li>
    <a href="./class-qdom-document.html" title="QDom_Document">QDom_Document</a>
  </li>
    <li>
    <a href="./class-qdom-element.html" title="QDom_Element">QDom_Element</a>
  </li>
    <li>
    <a href="./class-qfilter.html" title="QFilter">QFilter</a>
  </li>
    <li>
    <a href="./class-helper-image.html" title="Helper_Image">Helper_Image</a>
  </li>
    <li>
    <a href="./class-helper-imagegd.html" title="Helper_ImageGD">Helper_ImageGD</a>
  </li>
    <li>
    <a href="./class-helper-imgcode.html" title="Helper_ImgCode">Helper_ImgCode</a>
  </li>
    <li>
    <a href="./class-helper-imgcodesimple.html" title="Helper_ImgCodeSimple">Helper_ImgCodeSimple</a>
  </li>
    <li>
    <a href="./class-helper-imgcodettf.html" title="Helper_ImgCodeTTF">Helper_ImgCodeTTF</a>
  </li>
    <li>
    <a href="./class-helper-uploader.html" title="Helper_Uploader">Helper_Uploader</a>
  </li>
    <li>
    <a href="./class-helper-uploader-file.html" title="Helper_Uploader_File">Helper_Uploader_File</a>
  </li>
    <li>
    <a href="./class-qvalidator.html" title="QValidator">QValidator</a>
  </li>
    <li>
    <a href="./class-helper-yaml.html" title="Helper_YAML">Helper_YAML</a>
  </li>
  
</ul>


<h3>包 cache</h3>

<ul>
    <li>
    <a href="./class-qcache-apc.html" title="QCache_APC">QCache_APC</a>
  </li>
    <li>
    <a href="./class-qcache-file.html" title="QCache_File">QCache_File</a>
  </li>
    <li>
    <a href="./class-qcache-memcached.html" title="QCache_Memcached">QCache_Memcached</a>
  </li>
    <li>
    <a href="./class-qcache-memory.html" title="QCache_Memory">QCache_Memory</a>
  </li>
    <li>
    <a href="./class-qcache-phpdatafile.html" title="QCache_PHPDataFile">QCache_PHPDataFile</a>
  </li>
    <li>
    <a href="./class-qcache-xcache.html" title="QCache_XCache">QCache_XCache</a>
  </li>
  
</ul>


<h3>包 webcontrols</h3>

<ul>
    <li>
    <a href="./class-qui-control-abstract.html" title="QUI_Control_Abstract">QUI_Control_Abstract</a>
  </li>
    <li>
    <a href="./class-control-input-abstract.html" title="Control_Input_Abstract">Control_Input_Abstract</a>
  </li>
    <li>
    <a href="./class-control-button.html" title="Control_Button">Control_Button</a>
  </li>
    <li>
    <a href="./class-control-checkbox-abstract.html" title="Control_Checkbox_Abstract">Control_Checkbox_Abstract</a>
  </li>
    <li>
    <a href="./class-control-checkbox.html" title="Control_Checkbox">Control_Checkbox</a>
  </li>
    <li>
    <a href="./class-control-checkboxgroup-abstract.html" title="Control_CheckboxGroup_Abstract">Control_CheckboxGroup_Abstract</a>
  </li>
    <li>
    <a href="./class-control-checkboxgroup.html" title="Control_CheckboxGroup">Control_CheckboxGroup</a>
  </li>
    <li>
    <a href="./class-control-dropdownlist.html" title="Control_DropdownList">Control_DropdownList</a>
  </li>
    <li>
    <a href="./class-control-hidden.html" title="Control_Hidden">Control_Hidden</a>
  </li>
    <li>
    <a href="./class-control-label.html" title="Control_Label">Control_Label</a>
  </li>
    <li>
    <a href="./class-control-listbox.html" title="Control_Listbox">Control_Listbox</a>
  </li>
    <li>
    <a href="./class-control-memo.html" title="Control_Memo">Control_Memo</a>
  </li>
    <li>
    <a href="./class-control-password.html" title="Control_Password">Control_Password</a>
  </li>
    <li>
    <a href="./class-control-radio.html" title="Control_Radio">Control_Radio</a>
  </li>
    <li>
    <a href="./class-control-radiogroup.html" title="Control_RadioGroup">Control_RadioGroup</a>
  </li>
    <li>
    <a href="./class-control-reset.html" title="Control_Reset">Control_Reset</a>
  </li>
    <li>
    <a href="./class-control-static.html" title="Control_Static">Control_Static</a>
  </li>
    <li>
    <a href="./class-control-submit.html" title="Control_Submit">Control_Submit</a>
  </li>
    <li>
    <a href="./class-control-textbox.html" title="Control_Textbox">Control_Textbox</a>
  </li>
    <li>
    <a href="./class-control-upload.html" title="Control_Upload">Control_Upload</a>
  </li>
  
</ul>


<h3>包 behavior</h3>

<ul>
    <li>
    <a href="./class-model-behavior-acluser.html" title="Model_Behavior_AclUser">Model_Behavior_AclUser</a>
  </li>
    <li>
    <a href="./class-model-behavior-fastuuid.html" title="Model_Behavior_Fastuuid">Model_Behavior_Fastuuid</a>
  </li>
    <li>
    <a href="./class-model-behavior-relation.html" title="Model_Behavior_Relation">Model_Behavior_Relation</a>
  </li>
    <li>
    <a href="./class-model-behavior-uniqueness.html" title="Model_Behavior_Uniqueness">Model_Behavior_Uniqueness</a>
  </li>
  
</ul>


<h3>包 exception</h3>

<ul>
    <li>
    <a href="./class-qcache-exception.html" title="QCache_Exception">QCache_Exception</a>
  </li>
    <li>
    <a href="./class-q-classfileexistsexception.html" title="Q_ClassFileExistsException">Q_ClassFileExistsException</a>
  </li>
    <li>
    <a href="./class-q-classnotdefinedexception.html" title="Q_ClassNotDefinedException">Q_ClassNotDefinedException</a>
  </li>
    <li>
    <a href="./class-q-createdirfailedexception.html" title="Q_CreateDirFailedException">Q_CreateDirFailedException</a>
  </li>
    <li>
    <a href="./class-q-createfilefailedexception.html" title="Q_CreateFileFailedException">Q_CreateFileFailedException</a>
  </li>
    <li>
    <a href="./class-q-filenotfoundexception.html" title="Q_FileNotFoundException">Q_FileNotFoundException</a>
  </li>
    <li>
    <a href="./class-q-filenotreadableexception.html" title="Q_FileNotReadableException">Q_FileNotReadableException</a>
  </li>
    <li>
    <a href="./class-q-illegalclassnameexception.html" title="Q_IllegalClassNameException">Q_IllegalClassNameException</a>
  </li>
    <li>
    <a href="./class-q-illegalfilenameexception.html" title="Q_IllegalFilenameException">Q_IllegalFilenameException</a>
  </li>
    <li>
    <a href="./class-qlog-exception.html" title="QLog_Exception">QLog_Exception</a>
  </li>
    <li>
    <a href="./class-q-notimplementedexception.html" title="Q_NotImplementedException">Q_NotImplementedException</a>
  </li>
    <li>
    <a href="./class-q-removedirfailedexception.html" title="Q_RemoveDirFailedException">Q_RemoveDirFailedException</a>
  </li>
    <li>
    <a href="./class-qdb-exception.html" title="QDB_Exception">QDB_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-exception-duplicatekey.html" title="QDB_Exception_DuplicateKey">QDB_Exception_DuplicateKey</a>
  </li>
    <li>
    <a href="./class-qdb-select-exception.html" title="QDB_Select_Exception">QDB_Select_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-table-exception.html" title="QDB_Table_Exception">QDB_Table_Exception</a>
  </li>
    <li>
    <a href="./class-acluser-exception.html" title="AclUser_Exception">AclUser_Exception</a>
  </li>
    <li>
    <a href="./class-acluser-duplicateusernameexception.html" title="AclUser_DuplicateUsernameException">AclUser_DuplicateUsernameExcep...</a>
  </li>
    <li>
    <a href="./class-acluser-usernamenotfoundexception.html" title="AclUser_UsernameNotFoundException">AclUser_UsernameNotFoundExcept...</a>
  </li>
    <li>
    <a href="./class-acluser-wrongpasswordexception.html" title="AclUser_WrongPasswordException">AclUser_WrongPasswordException</a>
  </li>
    <li>
    <a href="./class-qform-exception.html" title="QForm_Exception">QForm_Exception</a>
  </li>
    <li>
    <a href="./class-qdom-exception.html" title="QDom_Exception">QDom_Exception</a>
  </li>
    <li>
    <a href="./class-qvalidator-exception.html" title="QValidator_Exception">QValidator_Exception</a>
  </li>
    <li>
    <a href="./class-qvalidator-validatefailedexception.html" title="QValidator_ValidateFailedException">QValidator_ValidateFailedExcep...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-exception.html" title="QDB_ActiveRecord_Association_Exception">QDB_ActiveRecord_Association_E...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-notdefinedexception.html" title="QDB_ActiveRecord_Association_NotDefinedException">QDB_ActiveRecord_Association_N...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-association-rejectexception.html" title="QDB_ActiveRecord_Association_RejectException">QDB_ActiveRecord_Association_R...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-behavior-exception.html" title="QDB_ActiveRecord_Behavior_Exception">QDB_ActiveRecord_Behavior_Exce...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-exception.html" title="QDB_ActiveRecord_Exception">QDB_ActiveRecord_Exception</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-calltoundefinedmethodexception.html" title="QDB_ActiveRecord_CallToUndefinedMethodException">QDB_ActiveRecord_CallToUndefin...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-changingreadonlypropexception.html" title="QDB_ActiveRecord_ChangingReadonlyPropException">QDB_ActiveRecord_ChangingReado...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-compositepkincompatibleexception.html" title="QDB_ActiveRecord_CompositePKIncompatibleException">QDB_ActiveRecord_CompositePKIn...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-destroywithoutidexception.html" title="QDB_ActiveRecord_DestroyWithoutIdException">QDB_ActiveRecord_DestroyWithou...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-expectsassocpropexception.html" title="QDB_ActiveRecord_ExpectsAssocPropException">QDB_ActiveRecord_ExpectsAssocP...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-meta-exception.html" title="QDB_ActiveRecord_Meta_Exception">QDB_ActiveRecord_Meta_Exceptio...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-settingproptypemismatchexception.html" title="QDB_ActiveRecord_SettingPropTypeMismatchException">QDB_ActiveRecord_SettingPropTy...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-undefinedpropexception.html" title="QDB_ActiveRecord_UndefinedPropException">QDB_ActiveRecord_UndefinedProp...</a>
  </li>
    <li>
    <a href="./class-qdb-activerecord-validatefailedexception.html" title="QDB_ActiveRecord_ValidateFailedException">QDB_ActiveRecord_ValidateFaile...</a>
  </li>
    <li>
    <a href="./class-qacl-exception.html" title="QACL_Exception">QACL_Exception</a>
  </li>
    <li>
    <a href="./class-qrouter-exception.html" title="QRouter_Exception">QRouter_Exception</a>
  </li>
    <li>
    <a href="./class-qrouter-invalidrouteexception.html" title="QRouter_InvalidRouteException">QRouter_InvalidRouteException</a>
  </li>
    <li>
    <a href="./class-qrouter-routenotfoundexception.html" title="QRouter_RouteNotFoundException">QRouter_RouteNotFoundException</a>
  </li>
    <li>
    <a href="./class-qview-exception.html" title="QView_Exception">QView_Exception</a>
  </li>
    <li>
    <a href="./class-qui-exception.html" title="QUI_Exception">QUI_Exception</a>
  </li>
  
</ul>


<h3>包 debug</h3>

<ul>
    <li>
    <a href="./class-qdebug.html" title="QDebug">QDebug</a>
  </li>
    <li>
    <a href="./class-qdebug-firephp.html" title="QDebug_FirePHP">QDebug_FirePHP</a>
  </li>
  
</ul>



    </div>

    <!-- /左侧栏 -->

    <!-- 右侧栏 -->

    <div id="col3" class="right contents span9">

      
<div class="apidoc-class">

  <h1>类 - QDB_Adapter_Abstract</h1>

  <ul class="nav nav-tabs">
    <li class="active"><a href="./index.html">所有包</a></li>

        <li><a href="#properties">类属性</a></li>
    
        <li><a href="#methods">类方法</a></li>
    

  </ul>

  
<table class="summary-table table table-bordered" cellpadding="0" cellspacing="0" >
  <tr>
    <th nowrap="nowrap">包</th>
    <td>database</td>
  </tr>
  <tr>
    <th nowrap="nowrap">类层次</th>
    <td>
    class QDB_Adapter_Abstract
    </td>
  </tr>

  
  
    <tr>
    <th nowrap="nowrap">版本</th>
    <td>$Id: abstract.php 2631 2009-07-18 06:02:33Z dualface $</td>
  </tr>
  
</table>

<div class="formatted">
  
<p>QDB_Adapter_Abstract 是所有数据库驱动的抽象基础类</p>
</div>


  <a name="properties"></a>

  
<div class="summary">

  <h2>保护的属性</h2>
  <p>
    <a href="#" class="toggle">隐藏继承的属性</a>
  </p>

  <table class="list-table table table-bordered">
    <tr>
      <th>属性</th><th>类型</th><th>描述</th><th>定义于</th>
    </tr>

    
    <tr>
      <td>$_dsn</td>
      <td>mixed</td>
      <td>数据库连接信息</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_id</td>
      <td>string</td>
      <td>数据库访问对象 ID</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_schema</td>
      <td>string</td>
      <td>默认的 schema</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_fetch_mode</td>
      <td>const</td>
      <td>指示返回结果集的形式</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_conn</td>
      <td>resource</td>
      <td>数据库连接句柄</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_log_enabled</td>
      <td>boolean</td>
      <td>是否将查询语句保存到日志</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_last_err</td>
      <td>mixed</td>
      <td>最后一次数据库操作的错误信息</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_last_err_code</td>
      <td>mixed</td>
      <td>最后一次数据库操作的错误代码</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_insert_id</td>
      <td>mixed</td>
      <td>最近一次插入操作或者 nextID() 操作返回的插入 ID</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_trans_count</td>
      <td>int</td>
      <td>指示事务启动次数</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_has_failed_query</td>
      <td>boolean</td>
      <td>指示事务执行期间是否发生了错误</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_savepoints_stack</td>
      <td>array</td>
      <td>SAVEPOINT 堆栈</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_true_value</td>
      <td></td>
      <td>用于描绘 true、false 和 null 的数据库值</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_false_value</td>
      <td></td>
      <td></td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_null_value</td>
      <td></td>
      <td></td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_timestamp_format</td>
      <td></td>
      <td>数据库接受的日期格式</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_bind_enabled</td>
      <td>boolean</td>
      <td>指示驱动是否支持原生的参数绑定</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_param_style</td>
      <td>string</td>
      <td>指示使用何种样式的参数占位符</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_has_insert_id</td>
      <td>boolean</td>
      <td>指示数据库是否有自增字段功能</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_affected_rows_enabled</td>
      <td>boolean</td>
      <td>指示数据库是否能获得更新、删除操作影响的记录行数量</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_transaction_enabled</td>
      <td>boolean</td>
      <td>指示数据库是否支持事务</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_savepoint_enabled</td>
      <td>boolean</td>
      <td>指示数据库是否支持事务中的 SAVEPOINT 功能</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
    <tr>
      <td>$_result_field_name_lower</td>
      <td>boolean</td>
      <td>指示是否将查询结果中的字段名转换为全小写</td>
      <td>
      	<small>
                QDB_Adapter_Abstract        		</small>
      </td>
    </tr>
    
  </table>
</div>



  <a name="methods"></a>
  
<div class="summary">
  <h2>公共方法</h2>
  <p>
    <a href="#" class="toggle">隐藏继承的方法</a>
  </p>

  <table class="list-table table table-bordered">
    <tr>
      <th>方法</th><th>描述</th><th>定义于</th>
    </tr>

        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getDSN">getDSN()</a>
      </td>

      <td>返回数据库访问对象使用的 DSN</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getID">getID()</a>
      </td>

      <td>返回数据库访问对象的 ID</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getSchema">getSchema()</a>
      </td>

      <td>返回数据库对象对应的 schema</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getTablePrefix">getTablePrefix()</a>
      </td>

      <td>返回数据库对象对应的表前缀</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_connect">connect()</a>
      </td>

      <td>连接数据库，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_pconnect">pconnect()</a>
      </td>

      <td>创建一个持久连接，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_nconnect">nconnect()</a>
      </td>

      <td>强制创建一个新连接，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_close">close()</a>
      </td>

      <td>关闭数据库连接</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_isConnected">isConnected()</a>
      </td>

      <td>确认是否已经连接到数据库</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_handle">handle()</a>
      </td>

      <td>返回连接数据库的句柄</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_setSchema">setSchema()</a>
      </td>

      <td>选择要操作的 SCHEMA</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_qstr">qstr()</a>
      </td>

      <td>转义值</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_qsql">qsql()</a>
      </td>

      <td>将 SQL 中用“[]”指示的字段名转义为完全限定名</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_qid">qid()</a>
      </td>

      <td>获得完全限定名</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_qids">qids()</a>
      </td>

      <td>获得多个完全限定名</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_identifier">identifier()</a>
      </td>

      <td>获得一个名字的规范名</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_qinto">qinto()</a>
      </td>

      <td>将 SQL 语句中的参数占位符替换为相应的参数值</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_insert">insert()</a>
      </td>

      <td>插入一条记录到数据库</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_update">update()</a>
      </td>

      <td>更新数据库中的记录</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_delete">delete()</a>
      </td>

      <td>删除指定数据表中符合条件的记录</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getPlaceholder">getPlaceholder()</a>
      </td>

      <td>返回输入数组键名及其对应的参数占位符和转义后的字段名</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_nextID">nextID()</a>
      </td>

      <td>为数据表产生下一个序列值，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_createSeq">createSeq()</a>
      </td>

      <td>创建一个新的序列，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_dropSeq">dropSeq()</a>
      </td>

      <td>删除一个序列，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_insertID">insertID()</a>
      </td>

      <td>获取自增字段的最后一个值或者 nextID() 方法产生的最后一个值</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_affectedRows">affectedRows()</a>
      </td>

      <td>返回最近一次数据库操作受到影响的记录数</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_execute">execute()</a>
      </td>

      <td>执行一个查询，返回一个查询对象或者 boolean 值，出错时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_select">select()</a>
      </td>

      <td>发起一个查询，获得一个 QDB_Select 查询对象</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_selectLimit">selectLimit()</a>
      </td>

      <td></td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getAll">getAll()</a>
      </td>

      <td>执行一个查询并返回记录集，失败时抛出异常</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getRow">getRow()</a>
      </td>

      <td>执行查询，返回第一条记录</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getOne">getOne()</a>
      </td>

      <td>执行查询，返回第一条记录的第一个字段</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_getCol">getCol()</a>
      </td>

      <td>执行查询，返回结果集的指定列</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_dbTimestamp">dbTimestamp()</a>
      </td>

      <td>将 unix timestamp 转换为数据库可以接受的日期格式</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_startTrans">startTrans()</a>
      </td>

      <td>开始一个事务</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_completeTrans">completeTrans()</a>
      </td>

      <td>完成事务，根据事务期间的查询是否出错决定是提交还是回滚事务</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_setTransFailed">setTransFailed()</a>
      </td>

      <td>指示在调用 completeTrans() 时回滚事务</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_hasFailedQuery">hasFailedQuery()</a>
      </td>

      <td>检查事务过程中是否出现失败的查询</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_metaColumns">metaColumns()</a>
      </td>

      <td>返回指定数据表（或者视图）的元数据</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_metaTables">metaTables()</a>
      </td>

      <td>获得所有数据表的名称</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_bindEnabled">bindEnabled()</a>
      </td>

      <td>确定驱动是否支持参数绑定</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_logEnabled">logEnabled()</a>
      </td>

      <td>确定是否把查询语句保存到日志</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_paramStyle">paramStyle()</a>
      </td>

      <td>返回驱动使用的参数占位符样式</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_parseSQL">parseSQL()</a>
      </td>

      <td>分析 SQL 中的字段名、查询条件，返回符合规范的 SQL 语句</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract_parseSQLInternal">parseSQLInternal()</a>
      </td>

      <td>分析 SQL 中的字段名、查询条件，返回符合规范的 SQL 语句（内部调用版本）</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
    
  </table>
</div>



<div class="summary">
  <h2>保护的方法</h2>
  <p>
    <a href="#" class="toggle">隐藏继承的方法</a>
  </p>

  <table class="list-table table table-bordered">
    <tr>
      <th>方法</th><th>描述</th><th>定义于</th>
    </tr>

        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract___construct">__construct()</a>
      </td>

      <td>构造函数</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract__parseSQLArray">_parseSQLArray()</a>
      </td>

      <td>按照模式 2（数组）对查询条件进行分析</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract__parseSQLString">_parseSQLString()</a>
      </td>

      <td>按照模式 1（字符串）对查询条件进行分析</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
        <tr>
      <td>
        <a href="#QDB_Adapter_Abstract__clear">_clear()</a>
      </td>

      <td>关闭数据库连接后清理资源</td>
      <td>
                QDB_Adapter_Abstract        
      </td>
    </tr>
    
  </table>
</div>



<div class="details">

  <h2>属性详细说明</h2>

    
  <a name="_dsn"></a>

  <div class="name property">
    <strong>$_dsn</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>数据库连接信息</p>
  </div>

    
  <a name="_id"></a>

  <div class="name property">
    <strong>$_id</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>数据库访问对象 ID</p>
  </div>

    
  <a name="_schema"></a>

  <div class="name property">
    <strong>$_schema</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>默认的 schema</p>
  </div>

    
  <a name="_fetch_mode"></a>

  <div class="name property">
    <strong>$_fetch_mode</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示返回结果集的形式</p>
  </div>

    
  <a name="_conn"></a>

  <div class="name property">
    <strong>$_conn</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>数据库连接句柄</p>
  </div>

    
  <a name="_log_enabled"></a>

  <div class="name property">
    <strong>$_log_enabled</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>是否将查询语句保存到日志</p>
  </div>

    
  <a name="_last_err"></a>

  <div class="name property">
    <strong>$_last_err</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>最后一次数据库操作的错误信息</p>
  </div>

    
  <a name="_last_err_code"></a>

  <div class="name property">
    <strong>$_last_err_code</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>最后一次数据库操作的错误代码</p>
  </div>

    
  <a name="_insert_id"></a>

  <div class="name property">
    <strong>$_insert_id</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>最近一次插入操作或者 nextID() 操作返回的插入 ID</p>
  </div>

    
  <a name="_trans_count"></a>

  <div class="name property">
    <strong>$_trans_count</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示事务启动次数</p>
  </div>

    
  <a name="_has_failed_query"></a>

  <div class="name property">
    <strong>$_has_failed_query</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示事务执行期间是否发生了错误</p>
  </div>

    
  <a name="_savepoints_stack"></a>

  <div class="name property">
    <strong>$_savepoints_stack</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>SAVEPOINT 堆栈</p>
  </div>

    
  <a name="_true_value"></a>

  <div class="name property">
    <strong>$_true_value</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>用于描绘 true、false 和 null 的数据库值</p>
  </div>

    
  <a name="_false_value"></a>

  <div class="name property">
    <strong>$_false_value</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
      </div>

    
  <a name="_null_value"></a>

  <div class="name property">
    <strong>$_null_value</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
      </div>

    
  <a name="_timestamp_format"></a>

  <div class="name property">
    <strong>$_timestamp_format</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>数据库接受的日期格式</p>
  </div>

    
  <a name="_bind_enabled"></a>

  <div class="name property">
    <strong>$_bind_enabled</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示驱动是否支持原生的参数绑定</p>
  </div>

    
  <a name="_param_style"></a>

  <div class="name property">
    <strong>$_param_style</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示使用何种样式的参数占位符</p>
  </div>

    
  <a name="_has_insert_id"></a>

  <div class="name property">
    <strong>$_has_insert_id</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示数据库是否有自增字段功能</p>
  </div>

    
  <a name="_affected_rows_enabled"></a>

  <div class="name property">
    <strong>$_affected_rows_enabled</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示数据库是否能获得更新、删除操作影响的记录行数量</p>
  </div>

    
  <a name="_transaction_enabled"></a>

  <div class="name property">
    <strong>$_transaction_enabled</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示数据库是否支持事务</p>
  </div>

    
  <a name="_savepoint_enabled"></a>

  <div class="name property">
    <strong>$_savepoint_enabled</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示数据库是否支持事务中的 SAVEPOINT 功能</p>
  </div>

    
  <a name="_result_field_name_lower"></a>

  <div class="name property">
    <strong>$_result_field_name_lower</strong>

    <span class="tags">属性</span>
  </div>

  <div class="signature">
      </div>

  <div class="formatted">
    
<p>指示是否将查询结果中的字段名转换为全小写</p>
  </div>

  
</div>


<div class="details">

  <h2>方法详细说明</h2>

    
  <a name="QDB_Adapter_Abstract___construct"></a>

  <h4 class="name method">
    __construct()
    <span class="tags">方法</span>
  </h4>
	<p>
	protected void <strong>__construct</strong>($dsn, $id)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$dsn</td>
      <td class="param_type">mixed</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$id</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>构造函数</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getDSN"></a>

  <h4 class="name method">
    getDSN()
    <span class="tags">方法</span>
  </h4>
	<p>
	public mixed <strong>getDSN</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回数据库访问对象使用的 DSN</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getID"></a>

  <h4 class="name method">
    getID()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>getID</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回数据库访问对象的 ID</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getSchema"></a>

  <h4 class="name method">
    getSchema()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>getSchema</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回数据库对象对应的 schema</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getTablePrefix"></a>

  <h4 class="name method">
    getTablePrefix()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>getTablePrefix</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回数据库对象对应的表前缀</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_connect"></a>

  <h4 class="name method">
    connect()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>connect</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>连接数据库，失败时抛出异常</p>

<p>如果已经连接到了数据库，再次连接不会造成任何影响。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_pconnect"></a>

  <h4 class="name method">
    pconnect()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>pconnect</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>创建一个持久连接，失败时抛出异常</p>

<p>如果已经连接到了数据库，再次连接不会造成任何影响。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_nconnect"></a>

  <h4 class="name method">
    nconnect()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>nconnect</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>强制创建一个新连接，失败时抛出异常</p>

<p>如果已经连接到了数据库，再次连接不会造成任何影响。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_close"></a>

  <h4 class="name method">
    close()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>close</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>关闭数据库连接</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_isConnected"></a>

  <h4 class="name method">
    isConnected()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>isConnected</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>确认是否已经连接到数据库</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_handle"></a>

  <h4 class="name method">
    handle()
    <span class="tags">方法</span>
  </h4>
	<p>
	public resource <strong>handle</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回连接数据库的句柄</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_setSchema"></a>

  <h4 class="name method">
    setSchema()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>setSchema</strong>($schema)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$schema</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>选择要操作的 SCHEMA</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_qstr"></a>

  <h4 class="name method">
    qstr()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public string <strong>qstr</strong>($value)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$value</td>
      <td class="param_type">mixed</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>转义值</p>

<p>为了能够在 SQL 语句中安全的插入数据，应该用 qstr()
方法将数据中的特殊字符转义。</p>

<p>example:</p>

<pre class=" code">$param = &quot;It's live&quot;;
$param = $dbo-&gt;qstr<span
class="br0">&#40;</span>$param<span
class="br0">&#41;</span>;
$sql = &quot;INSERT INTO posts <span
class="br0">&#40;</span>title<span class="br0">&#41;</span> VALUES <span
class="br0">&#40;</span><span class="br0">&#123;</span>$param<span
class="br0">&#125;</span><span
class="br0">&#41;</span>&quot;;
$dbo-&gt;execute<span
class="br0">&#40;</span>$sql<span class="br0">&#41;</span>;</pre>

<p>但更有效，而且更简单的方式是使用参数占位符：</p>

<p>example:</p>

<pre class="
code">$param = &quot;It's live&quot;;
$sql = &quot;INSERT INTO posts <span
class="br0">&#40;</span>title<span class="br0">&#41;</span> VALUES <span
class="br0">&#40;</span>?<span
class="br0">&#41;</span>&quot;;
$dbo-&gt;execute<span
class="br0">&#40;</span>$sql, array<span class="br0">&#40;</span>$param<span
class="br0">&#41;</span><span class="br0">&#41;</span>;</pre>

<p>而且对于 Oracle 等数据库，由于限制每条 SQL 语句不能超过
4000 字节，
因此在插入包含大量数据的记录时，必须使用参数占位符的形式。</p>

<p>example:</p>

<pre class=" code">$title = isset<span class="br0">&#40;</span>$POST<span
class="br0">&#91;</span>'title'<span class="br0">&#93;</span><span
class="br0">&#41;</span> ? $POST<span class="br0">&#91;</span>'title'<span
class="br0">&#93;</span> : null;
$body = isset<span
class="br0">&#40;</span>$POST<span class="br0">&#91;</span>'body'<span
class="br0">&#93;</span><span class="br0">&#41;</span> ? $POST<span
class="br0">&#91;</span>'body'<span
class="br0">&#93;</span> : null;
&nbsp;
... 检查 $title、$body 是否为空 ...
&nbsp;
$sql = &quot;INSERT INTO posts <span
class="br0">&#40;</span>title, body<span class="br0">&#41;</span> VALUES <span
class="br0">&#40;</span>:title, :body<span
class="br0">&#41;</span>&quot;;
$dbo-&gt;execute<span
class="br0">&#40;</span>$sql, array<span
class="br0">&#40;</span>'title' =&gt; $title, 'body' =&gt; $body<span
class="br0">&#41;</span><span class="br0">&#41;</span>;</pre>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_qsql"></a>

  <h4 class="name method">
    qsql()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>qsql</strong>($sql, $table_name, $mapping, $callback)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string</td>
      <td class="param_desc">要处理的 SQL 字符串</td>
    </tr>
    
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc">转义字段名时，使用什么数据表名称</td>
    </tr>
    
    <tr>
      <td class="param_name">$mapping</td>
      <td class="param_type">array</td>
      <td class="param_desc">字段名映射，用于将字段名转换为映射名</td>
    </tr>
    
    <tr>
      <td class="param_name">$callback</td>
      <td class="param_type">callback</td>
      <td class="param_desc">如果提取到数据表名称，则调用回调函数进行转换</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string</td>
      <td class="param_desc">转义后的 SQL 字符串</td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>将 SQL 中用“[]”指示的字段名转义为完全限定名</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_qid"></a>

  <h4 class="name method">
    qid()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>qid</strong>($name, $alias, $as)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$alias</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$as</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>获得完全限定名</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_qids"></a>

  <h4 class="name method">
    qids()
    <span class="tags">方法</span>
  </h4>
	<p>
	public array <strong>qids</strong>($names, $as)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$names</td>
      <td class="param_type">array|string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$as</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>获得多个完全限定名</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_identifier"></a>

  <h4 class="name method">
    identifier()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public string <strong>identifier</strong>($name)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>获得一个名字的规范名</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_qinto"></a>

  <h4 class="name method">
    qinto()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string|array <strong>qinto</strong>($sql, $params, $param_style, $return_parameters_count)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string</td>
      <td class="param_desc">要处理的 SQL 字符串</td>
    </tr>
    
    <tr>
      <td class="param_name">$params</td>
      <td class="param_type">array</td>
      <td class="param_desc">占位符对应的参数值</td>
    </tr>
    
    <tr>
      <td class="param_name">$param_style</td>
      <td class="param_type">enum</td>
      <td class="param_desc">占位符样式</td>
    </tr>
    
    <tr>
      <td class="param_name">$return_parameters_count</td>
      <td class="param_type">boolean</td>
      <td class="param_desc">是否返回占位符个数</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string|array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>将 SQL 语句中的参数占位符替换为相应的参数值</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_insert"></a>

  <h4 class="name method">
    insert()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>insert</strong>($table_name, $row, $restricted_fields)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc">要操作的数据表</td>
    </tr>
    
    <tr>
      <td class="param_name">$row</td>
      <td class="param_type">array</td>
      <td class="param_desc">要插入的记录数据</td>
    </tr>
    
    <tr>
      <td class="param_name">$restricted_fields</td>
      <td class="param_type">string|array</td>
      <td class="param_desc">限定只使用哪些字段</td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>插入一条记录到数据库</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_update"></a>

  <h4 class="name method">
    update()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>update</strong>($table_name, $row, $where, $restricted_fields)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc">要操作的数据表</td>
    </tr>
    
    <tr>
      <td class="param_name">$row</td>
      <td class="param_type">array|QDB_Expr</td>
      <td class="param_desc">要更新的数据</td>
    </tr>
    
    <tr>
      <td class="param_name">$where</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$restricted_fields</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>更新数据库中的记录</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_delete"></a>

  <h4 class="name method">
    delete()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>delete</strong>($table_name, $where)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$where</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>删除指定数据表中符合条件的记录</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getPlaceholder"></a>

  <h4 class="name method">
    getPlaceholder()
    <span class="tags">方法</span>
  </h4>
	<p>
	public array <strong>getPlaceholder</strong>($inputarr, $restricted_fields, $param_style)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$restricted_fields</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$param_style</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>返回输入数组键名及其对应的参数占位符和转义后的字段名</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_nextID"></a>

  <h4 class="name method">
    nextID()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public int <strong>nextID</strong>($table_name, $field_name, $start_value)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$field_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$start_value</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">int</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>为数据表产生下一个序列值，失败时抛出异常</p>

<p>调用 nextID() 方法，将获得指定名称序列的下一个值。
此处所指的序列，是指一个不断增大的数字。</p>

<p>假设本次调用 nextID() 返回 3，那么下一次调用 nextID()
就会返回一个比 3 更大的值。 nextID()
返回的序列值，可以作为记录的主键字段值，以便确保插入记录时总是使用不同的主键值。</p>

<p>可以使用多个序列，只需要指定不同的 $seq_name
参数即可。</p>

<p>在不同的数据库中，序列的产生方式各有不同。
PostgreSQL、Oracle
等数据库中，会使用数据库自带的序列功能来实现。
其他部分数据库会创建一个后缀为 _seq 表来存放序列值。</p>

<p>例如 $seq_name 为 posts，则存放该序列的表名称为
posts_seq。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_createSeq"></a>

  <h4 class="name method">
    createSeq()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>createSeq</strong>($seq_name, $start_value)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$seq_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$start_value</td>
      <td class="param_type">int</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>创建一个新的序列，失败时抛出异常</p>

<p>调用 nextID() 时，如果指定的序列不存在，则会自动调用
create_seq() 创建。 开发者也可以自行调用 create_seq()
创建一个新序列。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_dropSeq"></a>

  <h4 class="name method">
    dropSeq()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>dropSeq</strong>($seq_name)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$seq_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>删除一个序列，失败时抛出异常</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_insertID"></a>

  <h4 class="name method">
    insertID()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public int <strong>insertID</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>获取自增字段的最后一个值或者 nextID()
方法产生的最后一个值</p>

<p>某些数据库（例如 MySQL）可以将一个字段设置为自增。
也就是每次往数据表插入一条记录，该字段的都会自动填充一个更大的新值。</p>

<p>insertID()
方法可以获得最后一次插入记录时产生的自增字段值，或者最后一次调用
nextID() 返回的值。</p>

<p>如果在一次操作中，插入了多条记录，那么 insertID()
有可能返回的是第一条记录的自增值。
这个问题是由数据库本身的实现决定的。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_affectedRows"></a>

  <h4 class="name method">
    affectedRows()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public int <strong>affectedRows</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回最近一次数据库操作受到影响的记录数</p>

<p>这些操作通常是插入记录、更新记录以及删除记录。
不同的数据库对于其他操作，也可能影响到 affectedRows()
返回的值。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_execute"></a>

  <h4 class="name method">
    execute()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public QDB_Result_Abstract <strong>execute</strong>($sql, $inputarr)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">QDB_Result_Abstract</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>执行一个查询，返回一个查询对象或者 boolean
值，出错时抛出异常</p>

<p>$sql 是要执行的 SQL 语句字符串，而 $inputarr 则是提供给 SQL
语句中参数占位符需要的值。</p>

<p>如果执行的查询是诸如 INSERT、DELETE、UPDATE
等不会返回结果集的操作， 则 execute() 执行成功后会返回
true，失败时将抛出异常。</p>

<p>如果执行的查询是 SELECT 等会返回结果集的操作， 则
execute() 执行成功后会返回一个 DBO_Result
对象，失败时将抛出异常。</p>

<p>QDB_Result_Abstract 对象封装了查询结果句柄，而不是结果集。
因此要获得查询的数据，需要调用 QDB_Result_Abstract 的 fetchAll()
等方法。</p>

<p>如果希望执行 SQL 后直接获得结果集，可以使用驱动的
getAll()、getRow() 等方法。</p>

<p>example:</p>

<pre class=" code">$sql = &quot;INSERT INTO posts <span
class="br0">&#40;</span>title, body<span class="br0">&#41;</span> VALUES <span
class="br0">&#40;</span>?, ?<span
class="br0">&#41;</span>&quot;;
$dbo-&gt;execute<span
class="br0">&#40;</span>$sql, array<span
class="br0">&#40;</span>$title, $body<span class="br0">&#41;</span><span
class="br0">&#41;</span>;</pre>

<p>example:</p>

<pre class=" code">$sql = &quot;SELECT * FROM posts WHERE post_id &lt; <span
class="nu0">12</span>&quot;;
$handle = $dbo-&gt;execute<span
class="br0">&#40;</span>$sql<span
class="br0">&#41;</span>;
$rowset = $handle-&gt;fetchAll<span
class="br0">&#40;</span><span class="br0">&#41;</span>;
$handle-&gt;free<span
class="br0">&#40;</span><span class="br0">&#41;</span>;</pre>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_select"></a>

  <h4 class="name method">
    select()
    <span class="tags">方法</span>
  </h4>
	<p>
	public QDB_Select <strong>select</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>发起一个查询，获得一个 QDB_Select 查询对象</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_selectLimit"></a>

  <h4 class="name method">
    selectLimit()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>selectLimit</strong>($sql, $offset, $length, $inputarr)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$offset</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$length</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
      </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getAll"></a>

  <h4 class="name method">
    getAll()
    <span class="tags">方法</span>
  </h4>
	<p>
	public array <strong>getAll</strong>($sql, $inputarr)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>执行一个查询并返回记录集，失败时抛出异常</p>

<p>getAll() 等同于执行下面的代码：</p>

<pre class=" code">$rowset = $dbo-&gt;execute<span
class="br0">&#40;</span>$sql, $inputarr<span
class="br0">&#41;</span>-&gt;fetchAll<span class="br0">&#40;</span><span
class="br0">&#41;</span>;</pre>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getRow"></a>

  <h4 class="name method">
    getRow()
    <span class="tags">方法</span>
  </h4>
	<p>
	public mixed <strong>getRow</strong>($sql, $inputarr)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">mixed</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>执行查询，返回第一条记录</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getOne"></a>

  <h4 class="name method">
    getOne()
    <span class="tags">方法</span>
  </h4>
	<p>
	public mixed <strong>getOne</strong>($sql, $inputarr)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">mixed</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>执行查询，返回第一条记录的第一个字段</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_getCol"></a>

  <h4 class="name method">
    getCol()
    <span class="tags">方法</span>
  </h4>
	<p>
	public mixed <strong>getCol</strong>($sql, $col, $inputarr)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$sql</td>
      <td class="param_type">string|resource</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$col</td>
      <td class="param_type">int</td>
      <td class="param_desc">要返回的列，0 为第一列</td>
    </tr>
    
    <tr>
      <td class="param_name">$inputarr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">mixed</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>执行查询，返回结果集的指定列</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_dbTimestamp"></a>

  <h4 class="name method">
    dbTimestamp()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>dbTimestamp</strong>($timestamp)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$timestamp</td>
      <td class="param_type">int</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>将 unix timestamp 转换为数据库可以接受的日期格式</p>

<p>example:</p>

<pre class="
code">// 假设 created 是 DATETIME 类型的字段
$sql = &quot;INSERT INTO posts <span
class="br0">&#40;</span>title, body, created<span
class="br0">&#41;</span> VALUES <span class="br0">&#40;</span>?, ?, ?<span
class="br0">&#41;</span>&quot;;
$created = $dbo-&gt;dbTimestamp<span
class="br0">&#40;</span>time<span class="br0">&#40;</span><span
class="br0">&#41;</span><span class="br0">&#41;</span>;
$dbo-&gt;execute<span
class="br0">&#40;</span>$sql, array<span
class="br0">&#40;</span>$title, $body, $created<span
class="br0">&#41;</span><span class="br0">&#41;</span>;</pre>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_startTrans"></a>

  <h4 class="name method">
    startTrans()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>startTrans</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>开始一个事务</p>

<p>调用 startTrans()
开始一个事务后，应该在关闭数据库连接前调用 completeTrans()
提交或回滚事务。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_completeTrans"></a>

  <h4 class="name method">
    completeTrans()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public void <strong>completeTrans</strong>($commit_on_no_errors)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$commit_on_no_errors</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type"></td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>完成事务，根据事务期间的查询是否出错决定是提交还是回滚事务</p>

<p>如果 $commit_on_no_errors 参数为
true，当事务期间所有查询都成功完成时，则提交事务，否则回滚事务；
如果 $commit_on_no_errors 参数为 false，则强制回滚事务。</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_setTransFailed"></a>

  <h4 class="name method">
    setTransFailed()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>setTransFailed</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>指示在调用 completeTrans() 时回滚事务</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_hasFailedQuery"></a>

  <h4 class="name method">
    hasFailedQuery()
    <span class="tags">方法</span>
  </h4>
	<p>
	public void <strong>hasFailedQuery</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>检查事务过程中是否出现失败的查询</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_metaColumns"></a>

  <h4 class="name method">
    metaColumns()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public array <strong>metaColumns</strong>($table_name)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>返回指定数据表（或者视图）的元数据</p>

<p>返回的结果是一个二维数组，每一项为一个字段的元数据。
每个字段包含下列属性：</p>

<ul>
	<li>name: 字段名</li>

	<li>scale: 小数位数</li>

	<li>type: 字段类型</li>

	<li>ptype: 简单字段类型（与数据库无关）</li>

	<li>length: 最大长度</li>

	<li>not_null: 是否不允许保存 NULL 值</li>

	<li>pk: 是否是主键</li>

	<li>auto_incr: 是否是自动增量字段</li>

	<li>binary: 是否是二进制数据</li>

	<li>unsigned: 是否是无符号数值</li>

	<li>has_default: 是否有默认值</li>

	<li>default: 默认值</li>

	<li>desc: 字段描述</li>
</ul>

<p>ptype 是下列值之一：</p>

<ul>
	<li>c char/varchar 等类型</li>

	<li>x text 等类型</li>

	<li>b 二进制数据</li>

	<li>n 数值或者浮点数</li>

	<li>d 日期</li>

	<li>t TimeStamp</li>

	<li>l 逻辑布尔值</li>

	<li>i 整数</li>

	<li>r 自动增量</li>

	<li>p 非自增的主键字段</li>
</ul>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_metaTables"></a>

  <h4 class="name method">
    metaTables()
    <span class="tags">方法</span>
  </h4>
	<p>
	abstract public array <strong>metaTables</strong>($pattern, $schema)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$pattern</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$schema</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>获得所有数据表的名称</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_bindEnabled"></a>

  <h4 class="name method">
    bindEnabled()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>bindEnabled</strong>($enabled)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$enabled</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>确定驱动是否支持参数绑定</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_logEnabled"></a>

  <h4 class="name method">
    logEnabled()
    <span class="tags">方法</span>
  </h4>
	<p>
	public boolean <strong>logEnabled</strong>($enabled)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$enabled</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">boolean</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>确定是否把查询语句保存到日志</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_paramStyle"></a>

  <h4 class="name method">
    paramStyle()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>paramStyle</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>返回驱动使用的参数占位符样式</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_parseSQL"></a>

  <h4 class="name method">
    parseSQL()
    <span class="tags">方法</span>
  </h4>
	<p>
	public string <strong>parseSQL</strong>($table_name)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>分析 SQL 中的字段名、查询条件，返回符合规范的 SQL
语句</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract_parseSQLInternal"></a>

  <h4 class="name method">
    parseSQLInternal()
    <span class="tags">方法</span>
  </h4>
	<p>
	public array <strong>parseSQLInternal</strong>($table_name, $args)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$args</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>分析 SQL 中的字段名、查询条件，返回符合规范的 SQL
语句（内部调用版本）</p>

<p>与 parseSQL() 的区别在于 parseSQLInternal()
用第三参数来传递所有的占位符参数及参数值。 并且
parseSQLInternal() 的返回结果是一个数组， 分别由处理后的 SQL
语句、从 SQL
语句中分析出来的数据表名称、分析用到的参数个数组成。</p>

<pre class=" code">list<span
class="br0">&#40;</span>$sql, $used_tables, $args_count<span
class="br0">&#41;</span> = parseSQLInternal<span
class="br0">&#40;</span>...<span class="br0">&#41;</span>;</pre>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract__parseSQLArray"></a>

  <h4 class="name method">
    _parseSQLArray()
    <span class="tags">方法</span>
  </h4>
	<p>
	protected array <strong>_parseSQLArray</strong>($table_name, $arr, $args)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$arr</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$args</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>按照模式 2（数组）对查询条件进行分析</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract__parseSQLString"></a>

  <h4 class="name method">
    _parseSQLString()
    <span class="tags">方法</span>
  </h4>
	<p>
	protected array <strong>_parseSQLString</strong>($table_name, $where, $args)	</p>
  <table class="list-table table table-bordered">

        
    <tr>
      <td class="param_name">$table_name</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$where</td>
      <td class="param_type">string</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">$args</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
    <tr>
      <td class="param_name">{return}</td>
      <td class="param_type">array</td>
      <td class="param_desc"></td>
    </tr>
    
  </table>

  <div class="formatted">
    
<p>按照模式 1（字符串）对查询条件进行分析</p>
  </div>
	<hr>
    
  <a name="QDB_Adapter_Abstract__clear"></a>

  <h4 class="name method">
    _clear()
    <span class="tags">方法</span>
  </h4>
	<p>
	protected void <strong>_clear</strong>()	</p>
  <table class="list-table table table-bordered">

    
  </table>

  <div class="formatted">
    
<p>关闭数据库连接后清理资源</p>
  </div>
	<hr>
  
</div>


</div>


    </div>

    <!-- /右侧栏 -->
    </div>
	</div>
</body>
</html>
